<!DOCTYPE html>
<html lang="en">
<#assign ctx = request.contextPath />
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="${ctx}/static/mcCourse/css/Collage.css?v=2" rel="stylesheet">
    <title>拼团页面</title>

</head>
<body>
<div class="main">
    <#if app_type=='A'>
        <img class="collage" src="${ctx}/static/mcCourse/img/chahua.png">
    <#else>
        <img class="collage" src="${ctx}/static/mcCourse/img/T_chauha@3x.png">
    </#if>
    <div class="Count">
        <span class="title">${resultResponse.courseName}</span>
        <span class="grayfont">开课时间：${resultResponse.courseStartTime!""}-${resultResponse.courseEndTime!""}，${resultResponse.courseSize!""}课时</span>
        <div class="borderButtom"></div>
        <span class="Surplus" id="txt_timedown">
                剩余 <span class="Time" id="timeShow">23:45:01</span> 结束
            </span>
        <span class="PeopleNum">
                <span class="PNumber">${resultResponse.groupMaxUser}</span>人成团，还差<span class="PNumber">${resultResponse.remainGroupUser}</span>个名额，快来参加
            </span>
    </div>
</div>
<div class="footer">
    <div class="Explain">
        <span class="ExplainTitle">拼团规则说明</span>
        <span class="ExplainContext">
                1.点击右下角拼团购买，购买成功即可开团/参团。<br>
                2.通过微信邀请好友参加你的拼团。<br>
                3.有效期内专属拼团页参与人数达到要求即成功。<br>
                4.拼团成功会以短信通知（请不要屏蔽短信喔），在外教君 <br> APP进入“我的系统课”可查看课程。
            </span>
    </div>
    <div class="InvBtn">
        <a class="Invitation" href="jsToApp://mcCourseGroupShare" id="btn_share">邀请好友拼团</a>
    </div>
</div>
</body>
<script type="text/javascript" src="${ctx}/static/mcCourse/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="${ctx}/static/mcCourse/js/basis.js"></script>
<script>
    function checkTime(i)
    {
        if(i<10)
        {
            i="0"+i;
        }
        return i;
    }
    var time = setInterval('showTime()',500);
    function showTime()
    {
        var end_time ="${resultResponse.groupEndTime}";
        console.log(end_time);
        // 倒计时到什么时间
        var timedate= new Date(end_time);                //自定义结束时间
        var now = new Date();                                         //获取当前时间
        var date = parseInt(timedate.getTime() - now.getTime())/1000; //得出的为秒数；
        if(date <= 0)
        {
            document.getElementById("txt_timedown").innerHTML="<span class='Time'>已结束</span>";
            $("#btn_share").hide();
            clearInterval(time);
        }else{
            var day = parseInt(date/60/60/24);
            var hour = parseInt(date/60/60%24);
            var minute = parseInt(date/60%60);
            var second = parseInt(date%60);
            hour = checkTime(hour);
            minute = checkTime(minute);
            second = checkTime(second);
            var leftTime = hour+":"+minute+":"+second;
            document.getElementById('timeShow').innerHTML = leftTime;
            time;
        }
    }

</script>
</html>